#include <stdio.h>
int main(int argc, char const *argv[]) {
  int n,triangularNumber,number;
  printf("What triangular number do you want?\n");
  scanf("%i", &number);
  printf("---------------------------\n");
  printf("TABLE OF TRIANGULAR NUMBERS\n" );
  printf("---------------------------\n");
  printf("  n       Sum from 1 to n  \n");
  printf("-----   -------------------\n");
  triangularNumber = 0;
  for (int i = 1; i <= number; i++) {
    triangularNumber+=i;
    printf("%5i          %i\n", i ,triangularNumber );
  }
  return 0;
}
